package com.gitee.smalllog.core.utils;

public class BizResult<T> {
    /*错误码*/
    private String code;

    /*提示信息 */
    private String msg;

    /*具体内容*/
    private  T data;

    public BizResult(String code, String msg){
        this.code = code;
        this.msg = msg;
    }

    public BizResult() {

    }

    public static BizResult fail(String code, String message) {
        BizResult restResponse = new BizResult();
        restResponse.setCode(code);
        restResponse.setMsg(message);
        return restResponse;
    }

    public static BizResult success() {
        BizResult restResponse = new BizResult();
        restResponse.setCode("00");
        restResponse.setMsg("成功");
        return restResponse;
    }


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
